# Copyright (c) 2009 Daropia Project (www.daropia.org)
#
# This file is part of Daropia and is available under the terms
# of the GNU General Public Licence version 2.0 or later.


# Adds a table for the characters : Characters

Class.new(Sequel::Migration) do

	def up
		create_table(:characters) do
			primary_key :id
			String :name, :unique => true
			String :avatar
			String :signature
			String :description
			String :gender
			String :address
			Date :creation_date
			Boolean :activated, :default => false
			foreign_key :user_id
		end
		
		alter_table(:users) do
			add_column :character, Integer
		end
	end
			
	def down
		drop_table(:characters)
		
		alter_table(:users) do
			drop_column :character, Integer
		end
	end
	
end
			